﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Home" %>

<!DOCTYPE html>
<script type="text/javascript">
    function Confirm() {
        var confirm_value = document.createElement("INPUT");
        confirm_value.type = "hidden";
        confirm_value.name = "confirm_value";
        if (confirm("Do you want to delete data?")) {
            confirm_value.value = "Yes";
        } else {
            return false;
        }
        document.forms[0].appendChild(confirm_value);
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Label ID="lblHeader" runat="server" Text="Webboard"></asp:Label><br />
            <asp:Label ID="lblWelcome" runat="server"></asp:Label><br />
            <asp:Label ID="lblCountAllText" runat="server" Text="All"></asp:Label>
            <asp:Label ID="lblCountAll" runat="server"></asp:Label><br />
            <asp:Label ID="lblCountMeText" runat="server" Text="Me"></asp:Label>
            <asp:Label ID="lblCountMe" runat="server"></asp:Label><br />
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Insert.aspx">Insert</asp:HyperLink><br />
            <asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound" AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateField HeaderText="WebboardName">
                        <ItemTemplate>
                            <asp:Label ID="lblWName" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Owner">
                        <ItemTemplate>
                            <asp:Label ID="lblWOwner" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Edit">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server">Edit</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="return Confirm()">Delete</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </form>
</body>
</html>
